export function format(first: string, middle: string, last: string): string {
  return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');
}

export const mapAttrToElement = (target: any, eleId: string, attrName: string) => {
  const attr = target.slot.getAttribute(attrName)
  if(!attrName || !attr) return;
  target?.slot?.shadowRoot?.querySelector?.(eleId)?.setAttribute(attrName ?? '', attr ?? '');
};

export const mapStyleToElement = (target: any, eleId: string) => {
  mapAttrToElement(target, eleId, 'style');
};
